﻿class GCDAndLCM

{

    static void Main()

    {

        string[] input = Console.ReadLine().Split(' ');

        int m = int.Parse(input[0]);

        int n = int.Parse(input[1]);



        int gcd = CalculateGCD(m, n);

        int lcm = (m * n) / gcd;



        Console.WriteLine(gcd);

        Console.WriteLine(lcm);

    }



    static int CalculateGCD(int a, int b)

    {

        while (b != 0)

        {

            int temp = b;

            b = a % b;

            a = temp;

        }

        return a;

    }

}